package com.iuie.ns.devtools.element;

import com.iuie.ns.devtools.to.ResultMapDevHeaderTO;

public abstract class ResultMapMapperElement extends DevElement {
	
	private ResultMapDevHeaderTO header;
	
	public ResultMapMapperElement(ResultMapDevHeaderTO header) {
		this.header = header;
	}
	
	@Override
	protected String getPrefix() {
		StringBuilder prefix = new StringBuilder(12);
		prefix.append("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n")
			.append(header.getMybatisVersion())
			.append("\n")
			.append("<mapper namespace=\"")
			.append(header.getFullPath("mapper"))
			.append("\">\n\n");
		return prefix.toString();
	}

	@Override
	protected String getSuffix() {
		return "\n\n</mapper>";
	}

}
